package com.happyclub.lbjcontroller;

import com.happyclub.lbj.service.IActivityLike;
import com.happyclub.pojo.TbActivityLike;
import com.happyclub.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 高欢
 * @description 活动点赞表
 * @date 2019/4/5
 */
@RestController
@RequestMapping("/activityLike")
public class ActivityLikeController {

    @Autowired
    IActivityLike iActivityLike;

    @RequestMapping(value = "/getAllActLikeInfo/{activityId}",method = RequestMethod.GET)
    public JsonResult getAllActLike(@PathVariable String activityId){
        return iActivityLike.getAllActivityLike(activityId);
    }

    @RequestMapping(value = "/checkActivityLike/{activityId}/{userId}",method = RequestMethod.GET)
    public JsonResult checkActivityLike(@PathVariable String activityId,@PathVariable String userId){
        return iActivityLike.checkUserIsLike(activityId,userId);
    }

    @RequestMapping(value = "/saveActLike",method = RequestMethod.POST)
    public JsonResult saveActLike(@RequestBody TbActivityLike activityLike){
        return iActivityLike.saveActivityLike(activityLike);
    }


}
